package com.unnison.demo.client.dynamic;

import com.google.inject.Inject;

import com.unnison.demo.client.dynamic.DynamicPresenter;
import com.unnison.demo.client.dynamic.DynamicPresenter.DynamicBinder;
import com.unnison.demo.client.main.MainPresenter;
import com.unnison.framework.junit.GuitTest;

import junit.framework.Assert;

import org.junit.Before;
import org.junit.Test;

public class TestDynamicPresenter extends GuitTest {

    @Inject
    DynamicPresenter presenter;

    @Override
    protected void configure() {
        mock(DynamicBinder.class);
        mock(MainPresenter.class);
    }

    @Before
    public void setUp() {
        presenter.go(null);
    }

    @Test
    public void testDelete() {
        presenter.table$click("Button number 1");
        presenter.table$click("Button number 2");
        Assert.assertEquals(8, presenter.list.size());
    }

    @Test
    public void testReset() {
        presenter.reset$click();
        Assert.assertEquals(10, presenter.list.size());
    }
}
